<?php $post = $this->get('post');?>
<div class="x-list-title">
<table height="100%" width="100%" border="0" cellpadding="0">
<tr><td>
<h2><?php _e($post['title'])?></h2>
</td><td align="right">
<div class="x-list-options">
	<?php if( $post['created_by_id'] == get_user_id() ):?>
	<a href="#Contact/Index/Editperson?ID=<?php _e($post['ID'])?>" class="x-button x-button-add">Sửa liên hệ</a>
	<?php endif;?>
	<div class="x-options-container">
		<a class="x-button">Tác vụ khác <span>&#9660;</span></a>
		<div class="x-options">
			<a class="x-options-item" href="#Contact?type=person">Liên hệ cá nhân</a>
			<a class="x-options-item" href="#Contact?type=company">Liên hệ công ty</a>
			<a class="x-options-item" onclick="load_inframe('<?php _baseUrl();?>/Contact/Index/Label',{title: 'Quản lý nhãn liên hệ', css_content: 'width:420px;height:300px;overflow:auto;max-height:300px' })">Quản lý nhãn</a>			
			<a href="#Contact/Index/Addperson" class="x-options-item">Thêm liên hệ cá nhân</a>
			<a href="#Contact/Index/Addcompany" class="x-options-item">Thêm liên hệ công ty</a>
			<?php if( $post['created_by_id'] == get_user_id() ):?>
			<a onclick="module_delete('<?php _baseUrl()?>/Contact/Index/Delete?personID[]=<?php _e($post['ID'])?>')" class="x-options-item">Xóa liên hệ này</a></a>
			<?php endif;?>	
		</div>
	</div>
</div>
</td></tr></table>
</div>
<table width="100%" border="0" class="x-info" cellspacing="0">
<tr>
	<td colspan="5" align="right" class="x-info-top">
		<span class="tl">Chi tiết danh bạ</span>
		<span class="tr">Cập nhật và chia sẻ lúc <?php _e( show_date(DATETIME_FORMAT,$post['date_updated']) );?> bởi <?php _e(get_user_link( $post['updated_by_id'],$post['updated_by_name'],$post['updated_is_deleted']) );?></a></span>
	</td>
</tr>
<?php if( $post['created_by_id'] == get_user_id() ):?>
<tr><td colspan="5">
<i>Nhãn đang gán:</i>  
<?php if( count($this->get('labels')) > 0 ):?>
<?php foreach( $this->get('labels') as $a ):?>
<a href="#Contact?label_id=<?php _e($a['ID']);?>" style="font-size:11px;border:1px solid #ccc;padding:2px 3px"><?php _e( $a['label']);?></a>
<?php endforeach;?>
<?php else:?>

<?php endif;?>
</td></tr>
<?php endif;?>
<!--
<tr>
	<td rowspan="8" valign="top">
		<img style="width:120px" src="<?php _baseUrl()?>/files/contact/<?php _e($post['img'] ? $post['img'] : 'nologo.gif');?>"/>
	</td>
</tr>-->
<tr>
	<td class="x-info-label" nowrap="nowrap">
		Họ tên
	</td>
	<td class="x-info-content">
		<?php _e( $post['title'] );?>
	</td>
	<td class="x-info-label" nowrap="nowrap">
		Điện thoại
	</td>
	<td class="x-info-content">
		<?php _e( $post['phone'] );?>
	</td>
</tr>
<tr>
	<td class="x-info-label" nowrap="nowrap">
		Công ty
	</td>
	<td class="x-info-content">
		<a href="#Contact/Index/Viewcompany?ID=<?php _e( $post['company_id'] );?>"><?php _e( $post['company_title'] );?></a>
	</td>
	<td class="x-info-label" nowrap="nowrap">
		Phòng ban
	</td>
	<td class="x-info-content">
		<?php _e( $post['department'] );?>
	</td>
</tr>
<tr>	
	<td class="x-info-label" nowrap="nowrap">
		Chức vụ
	</td>
	<td class="x-info-content">
		<?php _e( $post['job_title'] );?>
	</td>
	<td class="x-info-label" nowrap="nowrap">
		Địa chỉ
	</td>
	<td class="x-info-content">
		<?php _e( $post['address'] );?>
	</td>	
</tr>
<tr>	
	<td class="x-info-label" nowrap="nowrap">
		Email
	</td>
	<td class="x-info-content">
		<?php _e( $post['email'] );?>
	</td>
	<td class="x-info-label" nowrap="nowrap">
		Địa chỉ khác
	</td>
	<td class="x-info-content">
		<?php _e( $post['address2'] );?>
	</td>	
</tr>
<tr>	
	<td class="x-info-label" nowrap="nowrap">
		Fax:
	</td>
	<td class="x-info-content">
		<?php _e( $post['fax'] );?>
	</td>	
	<td class="x-info-label" nowrap="nowrap">
		Di động
	</td>
	<td class="x-info-content">
		<?php _e( $post['mobile'] );?>
	</td>	
</tr>
<tr>	
	<td class="x-info-label" nowrap="nowrap">
		Chia sẻ cho
	</td>
	<td class="x-info-content">
		<?php $b=array();?>
		<?php if( $this->get('users') == 0):?><i>Chưa có ai</i><?php endif;?>
		<?php foreach( $this->get('users') as $a ):?>
		<?php $b[]= get_user_link($a);?>
		<?php endforeach;?>
		<?php _e(implode(', ',$b))?>
	</td>	

	<td class="x-info-label" nowrap="nowrap">
		Trang web
	</td>
	<td class="x-info-content">
		<?php _e( show_url($post['homepage']) );?>
	</td>
</tr>
<tr>	
	<td class="x-info-label" nowrap="nowrap">
		Ghi chú:
	</td>
	<td class="x-info-content" colspan="3">
		<?php _e( $post['desc'] );?>
	</td></tr>
</table>